<!-- 横向布局 -->
<script lang="ts" setup>
import ToolBarRight from '@/layouts/components/Hheader/ToolBarRight.vue'
import SubMenu from '@/layouts/components/Menu/SubMenu.vue'
import Main from '@/layouts/components/Main/index.vue'
import {computed} from 'vue'
import {useRoute} from 'vue-router'
import useRouteStore from '@/store/route.ts'
import useThemeStore from '@/store/theme.ts'

const route = useRoute()
const themeStore = useThemeStore()
const routeStore = useRouteStore()
const baseTitle = import.meta.env.VITE_APP_TITLE
const isCollapse = computed(() => themeStore.isCollapse)
const activeMenu = computed(() => (route.meta.activeMenu ? route.meta.activeMenu : route.path))
const menuList = computed(() => routeStore.getShowMenuList)
</script>

<template>
	<el-container class="layout">
		<el-header>
			<div class="logo flx-center">
				<img alt="logo" src="@/assets/images/logo.svg">
				<span>{{ baseTitle }}</span>
			</div>
			<el-menu
				:collapse="isCollapse"
				:collapse-transition="false"
				:default-active="activeMenu"
				:router="false"
				:unique-opened="true"
				active-text-color="#ffffff"
				background-color="#191a20"
				mode="horizontal"
				text-color="#dadada"
			>
				<SubMenu :menu-list="menuList"/>
			</el-menu>
			<ToolBarRight/>
		</el-header>
		<Main/>
	</el-container>
</template>

<style lang="scss" scoped>
@import "./index.scss";
</style>

<style lang="scss">
.transverse {
	// 横向菜单布局
	.el-menu--horizontal {
		height: 54px;

		.el-menu-item,
		.el-sub-menu {
			height: 54px !important;

			.el-sub-menu__title {
				height: 100%;
			}
		}

		.el-sub-menu__hide-arrow {
			width: 54px !important;
		}
	}

	.el-menu,
	.el-menu--popup {
		.el-menu-item {
			&.is-active {
				color: #ffffff;
				background: #060708;

				&::before {
					position: absolute;
					top: 0;
					bottom: 0;
					left: 0;
					width: 4px;
					content: "";
					background: var(--el-color-primary);
				}
			}
		}
	}

	// guide
	#driver-highlighted-element-stage {
		background-color: #606266 !important;
	}
}
</style>
